//
//  CBVedioListViewCell.m
//  CultureBreath
//
//  Created by lanou on 15/10/24.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "CBVedioListViewCell.h"
#import "UIImageView+WebCache.h"
@implementation CBVedioListViewCell

-(void)setVedioModel:(CBVedioModel *)vedioModel
{
    _vedioModel = vedioModel;
    [_pictureView sd_setImageWithURL:[NSURL URLWithString:vedioModel.coverForDetail]];
    _titleLabel.text = vedioModel.title;
    _typeTimeLabel.text = [NSString stringWithFormat:@"#%@ / %0.2d'%0.2d",vedioModel.category, vedioModel.duration/60, vedioModel.duration%60];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _pictureView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT/3)];
        [self.contentView addSubview:_pictureView];
        
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT/6-20, SCREEN_WIDTH, 30)];
        _titleLabel.textColor = [UIColor whiteColor];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_titleLabel];
        
        _typeTimeLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT/6+10, SCREEN_WIDTH, 20)];
        _typeTimeLabel.textColor = [UIColor whiteColor];
        _typeTimeLabel.textAlignment = NSTextAlignmentCenter;
        _typeTimeLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_typeTimeLabel];
    }
    return self;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
